<%@ page import="com.xyc.pojo.User" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>更新用户</title>
    <style>
        .style {
            text-align: center; /*让div内部文字居中*/
            background-color: #98F5FF;
            border-radius: 20px;
            width: 300px;
            height: 350px;
            margin: auto;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
    </style>
</head>
<body>
<div class="style">
    <h2 style="color:blue">更新用户资料</h2>
    <form action="updateUser" method="post">
        <table>
            <%User user = (User) request.getAttribute("user");%>
            <tr>
                <td>编号</td>
                <td><input type="text" readonly value="<%=user.getUser_id()%>" name="user_id"/></td>
            </tr>
            <tr>
                <td>昵称</td>
                <td><input type="text" value="<%=user.getUser_name()%>" name="user_name"/></td>
            </tr>
            <tr>
                <td>性别</td>
                <td><input type="text" value="<%=user.getSex()%>" name="sex"/></td>
            </tr>
            <tr>
                <td>年龄</td>
                <td><input type="text" value="<%=user.getAge()%>" name="age"/></td>
            </tr>
            <tr>
                <td>邮箱</td>
                <td><input type="text" value="<%=user.getEmail()%>" name="email"/></td>
            </tr>
            <tr>
                <td>会员</td>
                <td><input type="text" value="<%=user.getIsVip()%>" name="isVip"/></td>
            </tr>
            <tr>
                <td>可用</td>
                <td><input type="text" value="<%=user.getIsUse()%>" name="isUse"/></td>
            </tr>
            <%
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                String create = sdf.format(user.getCreate_time());
                String last = sdf.format(user.getLast_time());
            %>
            <tr>
                <td>会员开通</td>
                <td><input type="text" value="<%=create%>" name="create_time"/></td>
            </tr>
            <tr>
                <td>会员到期</td>
                <td><input type="text" value="<%=last%>" name="last_time"/></td>
            </tr>
        </table>
        <p><input type="submit" value="提交"/></p>
    </form>
</div>
</body>
</html>
